home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / FROMUTS / UNIXLIB37B / test / c / systest < prev    next >
Text File  |  1992-03-16  |  293b  |  23 lines

  1. #include <string.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. #include "sys/syslib.h"
  6.  
  7. int main()
  8. {
  9. int i;
  10. char b[256];
  11.  
  12. for (;;)
  13.   {
  14.   if (!fgets(b,256,stdin)) break;
  15.   b[strlen(b) - 1] = 0;
  16.   i = system(b);
  17.   if (i < 0)
  18.     perror("system()");
  19.   else
  20.     printf("Return Value: %d\n",i);
  21.   }
  22. }
  23.